home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol A-4 / (Vol A-4) Vol. A4.iso / Games / smashing.swf / scripts / DefineSprite_62_mcBonus / frame_10 / DoAction.as
Text File  |  2008-03-12  |  3KB  |  89 lines

  1. brickSmashed = true;
  2. if(!expired)
  3. {
  4.    if(pointsWorth == "PORTAL")
  5.    {
  6.       _parent.sndTeleport();
  7.       _parent._parent.sndTeleport();
  8.       ball._x = _parent.portal._x;
  9.       ball._y = _parent.portal._y;
  10.       ball.TargetX = _parent.portal._x;
  11.       ball.TargetY = _parent.portal._y;
  12.       ball.testMoveX = _parent.portal._x;
  13.       ball.testMoveY = _parent.portal._y;
  14.       ball.testMoveXTemp = _parent.portal._x;
  15.       ball.testMoveYTemp = _parent.portal._y;
  16.       _parent.portal.gotoAndPlay("out");
  17.    }
  18.    else if(pointsWorth == "SPEEDBALL")
  19.    {
  20.       _parent.sndRicochet.start();
  21.       while(_root.makePositive(ball.SpeedX,true) < _root.maxSpeed && _root.makePositive(ball.SpeedY,true) < _root.maxSpeed)
  22.       {
  23.          if(ball.SpeedX >= 0)
  24.          {
  25.             ball.SpeedX = ball.SpeedX + 1;
  26.          }
  27.          else
  28.          {
  29.             ball.SpeedX--;
  30.          }
  31.          if(ball.SpeedY >= 0)
  32.          {
  33.             ball.SpeedY = ball.SpeedY + 1;
  34.          }
  35.          else
  36.          {
  37.             ball.SpeedY--;
  38.          }
  39.       }
  40.    }
  41.    else if(pointsWorth == "MULTIBALL")
  42.    {
  43.       _parent._parent.generateBall(false,ball._x,ball._y);
  44.       _parent._parent.generateBall(false,ball._x,ball._y);
  45.    }
  46.    else if(pointsWorth == "SLOWBALL")
  47.    {
  48.       _parent.sndSlowball.start();
  49.       ball.SpeedX /= 2;
  50.       ball.SpeedY /= 2;
  51.    }
  52.    else if(pointsWorth == "POWERBALL")
  53.    {
  54.       _parent.sndPowerball.start();
  55.       ball.powerBall = true;
  56.       ball.goldenBall = false;
  57.       ball.ball.gotoAndStop("power");
  58.    }
  59.    else if(pointsWorth == "GOLDEN BALL")
  60.    {
  61.       ball.goldenBall = true;
  62.       ball.powerBall = false;
  63.       ball.ball.gotoAndStop("golden");
  64.    }
  65.    else if(pointsWorth == "INVISIBLE")
  66.    {
  67.       _parent.sndInvisible.start();
  68.       ball.goldenBall = false;
  69.       ball.powerBall = false;
  70.       ball.ball.gotoAndPlay("invisible");
  71.    }
  72.    else if(pointsWorth == "T.N.T.")
  73.    {
  74.       _root.clipCounter = _root.clipCounter + 1;
  75.       _root.attachMovie("mcExplosion","mcExplosion" + _root.clipCounter,_root.clipCounter);
  76.       x = eval(_target);
  77.       y = eval(_target);
  78.       _root["mcExplosion" + _root.clipCounter]._x = x._x;
  79.       _root["mcExplosion" + _root.clipCounter]._y = y._y;
  80.       _root["mcExplosion" + _root.clipCounter]._rotation = random(360);
  81.    }
  82.    else if(0 < pointsWorth)
  83.    {
  84.       _parent.sndPop.start();
  85.    }
  86. }
  87. _width = _width - _width / 7;
  88. _height = _height - _height / 7;
  89.